<?php

namespace App\Domain;

use App\Model\Spec as ModelSpec;

header('content-type:text/html;charset=utf-8');
/*
 * 杂项domail层
 * 领域业务层，负责对领域业务的规则处理，重点关注对数据的逻辑处理、转换和加工，封装并体现特定领域业务的规则
 */

class Spec {

    public function getAll() {
        $rs = [];
        $model = new ModelSpec();
        $items = $model->getAll();
        $rs['items'] = $items;
        return $rs;
    }

    public function getBatch($specid) {
        $rs = [];
        $model = new ModelSpec();
        $items = $model->getBatch($specid);
        $arcarr = explode(',', $items[0]['arcid']);
        $rs = $items[0];
        unset($rs['arcid']);
        $rs['arclist'] = $arcarr;
        return $rs;
    }

}
